<?php

error_reporting(E_ALL);
//error_reporting(0);

require_once(dirname(dirname(dirname(__FILE__))) . '/appconf.php');

$local_config = array(
    'table'          => 'mapi_itrial_version',
);

class v2013_hktb_version extends CGIApplication{


  function setup(){
    $this->run_modes('list');
    $this->start_mode('list');
    
	  $this->set_path_info_position(array('device' => 0, 
                                        'version' => 1,  
                                        ));    
    parent::setup();
    $this->mode_param(array('path_info' => 0, 'param' => 'action')); // for not to use first param as action
  }
  

  function action_list(){    
    $device_detail         = $this->get_param('p', 'device', '');
  	$version    = $this->get_param('p', 'version', '');
  	
    list($platform) = explode(":", $device_detail);
    
    $data = $bookshelf->check_app_update_with_version($platform, $version);
    return $bookshelf->to_json($data);
  }
  



}//end class

$webapp = new v2013_hktb_version(
 array('PARAMS' => array_merge($site_global_config, $local_config))
);
$webapp->run();
?>